<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>已注册产品</title>

		<link href="../../plugin/css/fonts/font-awesome.min.css" rel="stylesheet">
		<link rel="stylesheet" href="../../plugin/weui/css/weui.min.css">
		<link rel="stylesheet" href="../../plugin/weui/css/jquery-weui.min.css">
		<link rel="stylesheet" href="../../plugin/mui/css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="../../plugin/mui/css/app.css" />
		<link rel="stylesheet" type="text/css" href="../css/global.css" />
		<link rel="stylesheet" type="text/css" href="../css/productDetails.css" />
	</head>

	<body>
		<div id="app" v-show="isShow" v-cloak>
			<div class="m-cell">
				<!--内容区-->
				<div class="mui-card-content">
					<div class="cardLeft">
						<!-- <img src="img/e101.png" /> -->
						<img :src="productData.productImage"/>
					</div>
					<div class="cardRight">
						<div class="productName">
							<span>{{productData.productName}}</span>
						</div>
						<div class="pruductBtn">
							<a :href="'warranty.html?id='+productData.id" class="mui-btn">一键报修</a>
							<a href="orderList.html" class="mui-btn">售后记录</a>
						</div>
					</div>
				</div>
			</div>
			<div class="content-block-title">产品信息:</div>
			<div class="m-cell">
				<div class="weui-form-preview__bd">
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">产品序列号</label>
						<span class="weui-form-preview__value">{{productData.serialNo}}</span>
					</div>
					<div class="weui-form-preview__item cell-item2">
						<label class="weui-form-preview__label">发票凭证</label>
						<span div class="productImg weui-form-preview__value">
                             <img :src="getCosFile(productData.receiptPath)" /> 
                    </span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">经销商</label>
						<span class="weui-form-preview__value">{{ productData.agency}}</span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">购买日期</label>
						<span class="weui-form-preview__value">{{productData.purchaseDate}}</span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">保修期至</label>
						<span class="weui-form-preview__value">{{productData.registerDate}}</span>
					</div>
				</div>
			</div>
			<div class="content-block-title">客户信息:</div>
			<div class="m-cell">
				<div class="weui-form-preview__bd">
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">联系人</label>
						<span class="weui-form-preview__value">{{productData.length === 0 ? '':productData.customerInfo.name}}</span>
					</div>
					<div class="weui-form-preview__item">
						<label class="weui-form-preview__label">联系电话</label>
						<span class="weui-form-preview__value">{{productData.length === 0 ? '':productData.customerInfo.tel}}</span>
					</div>
				</div>
			</div>
		</div>
		<script src="../../plugin/jquery/jquery-2.2.3.min.js"></script>
		<script src="../../plugin/vue/vue.min.js"></script>
		<script src="../../plugin/weui/js/jquery-weui.min.js"></script>
		<script src="../../plugin/mui/js/mui.min.js"></script>
		
		<script src="../../common/server.js"></script>
		<script src="../../common/common.js"></script>
		<script>
			var app=new Vue({
				el: '#app',
				data: {
					productData: [],
					isShow:false
				},
				mounted: function () {
					this.$nextTick(function () {
						var productId = getUrlParam('productId');
						Server.getFromCustomer('/searchRegisterDataById', {id: productId}, function(result){
							if(result.code === 100){
								app.productData = result.data.data;
								app.isShow = true;
							}
						});
					})
				}
			})
		</script>
	</body>

</html>